/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.inria.openmath.omapi.implementation;

/**
 *
 * @author Mr.Sam
 */

import fr.inria.openmath.omapi.*;

public class BindNodeImpl extends NodeImpl implements BindNode {

    public BindNodeImpl () {
        this.type = Node.OM_BIND;
    }

    /**
     * @see fr.inria.openmath.omapi.BindNode#getBinder
     */
    public Node getBinder() {
        return this.getFirstChild();
    }

    /**
     * @see fr.inria.openmath.omapi.BindNode#getFirstBoundVar
     */
    public Node getFirstBoundVar() {
        Node n = this.getBoundObject();
        if (n != null) {
            return n.getNextSibling();
        } else {
            return null;
        }
    }

    /**
     * @see fr.inria.openmath.omapi.BindNode#getBoundObject
     */
    public Node getBoundObject() {
        Node n = this.getFirstChild();
        if (n != null) {
            return n.getNextSibling();
        } else {
            return null;
        }
    }

}
